function points2D = project(points3D, M)
[rows cols] = size(points3D);
points2D = zeros(rows,2);
for i = 1:rows
    P3D = [points3D(i,:) 1]';
    z = DOT(M(3,:),P3D);
    P2D = floor((1/z)*M*P3D);
    points2D(i,:) = [P2D(1) P2D(2)];    
end
end